local skill = fk.CreateSkill{
  name = "tuntian__enemy_at_the_gates_skill",
}

Fk:loadTranslationTable{
  ["tuntian__enemy_at_the_gates_skill"] = "兵临城下",
  ["#tuntian__enemy_at_the_gates_skill"] = "选择一名其他角色，你亮出牌堆顶四张牌，依次对其使用其中的【杀】，然后将剩余牌置入弃牌堆。",
}

skill:addEffect("cardskill", {
  prompt = "#tuntian__enemy_at_the_gates_skill",
  can_use = Util.CanUse,
  target_num = 1,
  mod_target_filter = function(self, player, to_select, selected)
    return to_select ~= player
  end,
  target_filter = Util.CardTargetFilter,
  on_effect = function (self, room, effect)
    local player = effect.from
    local to = effect.tos[1]
    local cards = room:getNCards(4)
    room:turnOverCardsFromDrawPile(player, cards, skill.name, true)
    for i = 1, 4 do
      local id = cards[i]
      table.insert(cards, id)
      local card = Fk:getCardById(id)
      if card.trueName == "slash" and not player:prohibitUse(card) and not player:isProhibited(to, card) and to:isAlive() then
        card.skillName = skill.name
        room:useCard({
          card = card,
          from = player,
          tos = { to },
          extraUse = true,
        })
      end
    end

    room:cleanProcessingArea(cards, "tuntian__enemy_at_the_gates")
  end,
})

return skill